package org.shiwen.week6;

public class StudentV3 {
    private String name;
    private int age;
    private String gender;
    private String ID;

    //这里为了让变量见名知意，将变量名和属性名一致，但是会出现一个问题，无法正确的赋值
    public StudentV3(String name, int age, String gender, String ID) {
        name = name;
        age = age;
        gender = gender;
        ID = ID;
    }

    public StudentV3() {
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public void showInfo() {
        System.out.println("姓名：" + name + "，年龄：" + age + "，性别：" + gender + "，学号：" + ID);
    }

}
